package com.ruoyi.order.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.order_address.domain.OrderAddress;
import com.ruoyi.shopping_cart.domain.ShoppingCart;
import com.ruoyi.user.domain.User;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 订单对象 sys_order
 * 
 * @author 张富饶
 * @date 2025-05-20
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Order extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** id */
    private Long id;

    /** 订单编号 */
    @Excel(name = "订单编号")
    private String orderNo;

    /** 买家ID */
    @Excel(name = "买家ID")
    private Long buyerId;

    /** 卖家ID */
    @Excel(name = "卖家ID")
    private Long sellerId;

    /** 购物车id */
    @Excel(name = "购物车id")
    private Long cartId;

    /** 地址快照ID */
    @Excel(name = "地址快照ID")
    private Long addressId;

    /** 购买数量 */
    @Excel(name = "购买数量")
    private Long quantity;

    /** 订单总额 */
    @Excel(name = "订单总额")
    private BigDecimal totalAmount;

    /** 支付方式（0-钱包 1-支付宝 2-微信） */
    @Excel(name = "支付方式", readConverterExp = "0=-钱包,1=-支付宝,2=-微信")
    private Integer paymentMethod;

    /** 物流单号 */
    @Excel(name = "物流单号")
    private String logisticsNo;

    /** 订单状态（0-待支付 1-已支付 2-已发货 3-已完成 4-已取消 5-退款中） */
    @Excel(name = "订单状态", readConverterExp = "0=-待支付,1=-已支付,2=-已发货,3=-已完成,4=-已取消,5=-退款中")
    private Integer status;

    /** 完成时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date completeTime;
//    用户信息表
private User user;
//购物车
    private ShoppingCart shoppingCart;
//    订单地址
    private OrderAddress orderAddress;

}
